package com.yqg.manage.mapper;

import com.github.yulichang.base.MPJBaseMapper;
import com.yqg.manage.controller.dto.RoleAndUnitDTO;
import com.yqg.manage.entity.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author suzhuang
 * @since 2023-07-05
 */
public interface RoleMapper extends MPJBaseMapper<Role> {

    List<RoleAndUnitDTO> getRoleAndUnitData(@Param("pageNum") Long pageNum, @Param("pageSize") Long pageSize,
                                            @Param("unitId") Long unitId, @Param("roleLevel") Long roleLevel);

    Integer getRoleAndUnitDataCount(@Param("unitId") Long unitId, @Param("roleLevel") Long roleLevel);

    /**
     * 副书记获取分页数据
     */
    List<RoleAndUnitDTO> deputyDirectorFindPage(@Param("pageNum") Long pageNum, @Param("pageSize") Long pageSize,
                                                @Param("unitId") Long unitId, @Param("roleLevel") Long roleLevel,
                                                @Param("userId") Long userId);

    Integer deputyDirectorFindPageCount(@Param("unitId") Long unitId, @Param("roleLevel") Long roleLevel,
                                        @Param("userId") Long userId);
}
